# This should only be run when setting up a new box
# you will need to:
# puppetd --...
# apt-get update
# puppetd --..
# once done do not use as because we do not want to
# overwrite the Packages.gz once we've started using Maya

class builder {
  package { dpkg-dev: ensure => latest }

  file { "/etc/apt/sources.list.d":
    ensure => directory,
    owner  => "root",
    group  => "root",
    mode   => 755,
  }
  
  file { "/etc/apt/sources.list.d/maya.source.list":
    owner  => "root",
    group  => "root",
    mode   => 644,
    source	=> "$moduleserver/maya_builder/maya.source.list",
    require => File["/etc/apt/sources.list.d"],
  }

  package { libappconfig-perlmaya: ensure => latest }
  package { libnumber-compare-perlmaya: ensure => latest }
  package { libmodule-build-perlmaya: ensure => latest }
  package { libtext-glob-perlmaya: ensure => latest }
  package { libfile-find-rule-perlmaya: ensure => latest }
  package { libfile-homedir-perlmaya: ensure => latest }
  package { libpath-class-perlmaya: ensure => latest }

  package { libclass-accessor-perlmaya: ensure => latest }
  package { libclass-accessor-chained-perlmaya: ensure => latest }
  package { libcompress-raw-zlib-perlmaya: ensure => latest }
  package { libio-compress-base-perlmaya: ensure => latest }
  package { libio-compress-zlib-perlmaya: ensure => latest }
  package { libcompress-zlib-perlmaya: ensure => latest }
  package { liburi-perlmaya: ensure => latest }
  package { libhtml-tagset-perlmaya: ensure => latest }
  package { libhtml-parser-perlmaya: ensure => latest }
  package { liblibwww-perl-perlmaya: ensure => latest }
  package { libapp-cache-perlmaya: ensure => latest }

  package { libversion-perlmaya: ensure => latest }
  package { libmodule-load-conditional-perlmaya: ensure => latest }
  package { libmodule-load-perlmaya: ensure => latest }
  package { libipc-cmd-perlmaya: ensure => latest }

  package { liblocale-maketext-simple-perlmaya: ensure => latest }
  package { libparams-check-perlmaya: ensure => latest }
  package { libarchive-extract-perlmaya: ensure => latest }

  package { libfile-slurp-perlmaya: ensure => latest }
  package { liblist-moreutils-perlmaya: ensure => latest }
  package { libmodule-corelist-perlmaya: ensure => latest }
  package { libyaml-perlmaya: ensure => latest }
  package { libmodule-depends-perlmaya: ensure => latest }

  package { libio-zlib-perlmaya: ensure => latest }
  package { libcpan-distnameinfo-perlmaya: ensure => latest }
  package { libparse-cpan-packages-perlmaya: ensure => latest }

  # Mirror structure
  file { "/var/www/debian":
  	ensure => directory,
  	owner  => "web",
  	group  => "web",
  	recurse => "true",
  	source	=> "$moduleserver/maya_builder/debian",
  }

  # Create symlink
  file { "/var/www/debian/test/dists/etch/main/binary-i386/Packages.gz":
    ensure => "/var/www/debian/test/binary/Packages.gz",
    require => File["/var/www/debian"],
  }

  # Create symlink
  file { "/var/www/debian/live/dists/etch/main/binary-i386/Packages.gz":
    ensure => "/var/www/debian/live/binary/Packages.gz",
    require => File["/var/www/debian"],
  }


}

